<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css显示与隐藏</title>
    <style>
        .bjt {
            position: relative;
            width: 520px;
            height: 480px;
            margin: 50px auto;
        }
        img {
            width: 100%;
            height: 100%;
        }
        .mask {
            display: none;
            position: absolute;
            width: 520px;
            height: 480px;
            top: 0;
            left: 0;
            background-color: rgba(0,0,0,.3);
        }
        .bjt:hover .mask{
            display: block;
        }
    </style>
</head>
<body>
    <div class="bjt">
        <div class="mask"></div>
        <img src="../images/3.webp" alt="">
    </div>
</body>
</html>